package repproyectobases;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;
/**
*  @web http://jc-mouse.blogspot.com/
 * @author Mouse
 */
public class Detalle extends javax.swing.JInternalFrame {
    private Control ctrl;
    static private Interfaz in;
    private AdministracionBD miAbd;
    public static Detalle me;
    ArrayList <Object[]> res;
    private int view=0;

    public static Detalle getDetalle(Control ctrl,int view,Interfaz in,AdministracionBD miAbd)
    {
        if (me == null)
            me = new Detalle(ctrl,view,in,miAbd);
	return me;	
    }

    /** Creates new form Detalle */
    public Detalle(Control ctrl,int view,Interfaz in,AdministracionBD miAbd) 
    {
        initComponents();
        Detalle.in=in;
        this.miAbd=miAbd;
        this.ctrl = ctrl;
        res = new ArrayList<Object[]>();
        setVistaDetalle(view);
    }
    
    public int getView() 
    {
        return view;
    }

    public void setView(int view) 
    {
        this.view = view;
        setVistaDetalle(view);
    }
   
    private void setVistaDetalle(int view)
    {
        //res = new ArrayList<Object[]>();
        switch (view)
        {
            case 1: 
                this.setTitle("Detalle de Facturas de ventas by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
            case 2:
                this.setTitle("Detalle de Empleado by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
            case 3:
                this.setTitle("Detalle de Cliente by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
            case 4:
                this.setTitle("Detalle de Repuestos by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
            case 5:
                this.setTitle("Detalle de Motos by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
            case 6:
                this.setTitle("Detalle de Proveedores by Luis&Luis");
                updateTabla(view);
                updateLabels(view);
                break;
        }
    }
    
    private void cleanTextFields()
    {
         jTextField1.setText("");
         jTextField2.setText("");
         jTextField3.setText("");
         jTextField4.setText("");
         jTextField5.setText("");
         jTextField6.setText("");
         jTextField7.setText("");
         jTextField8.setText("");
         jTextField9.setText("");
         jTextField10.setText("");
         jTextField11.setText("");
         jTextField12.setText("");
    }

    private void updateLabels(int view)
    {
        switch (view)
        {
            case 1:
                jLabel1.setText("IdFactura*: ");
                jLabel2.setText("Fecha de Compra*: ");
                jLabel3.setText("Observacion*: ");
                jLabel4.setText("Cedula del Empleado*: ");
                jLabel5.setText("Nombre del Empleado*: ");
                jLabel6.setText("Cedula del Cliente*: ");
                jLabel7.setText("Nombre del Cliente*: ");
                jLabel8.setText("IdRepuesto*: ");
                jLabel9.setText("Nombre del repuesto*: ");
                jLabel10.setText("Cantidad Comprada*: ");
                jLabel11.setText("Valor por Unidad*: ");
                jLabel12.setText("Total*: ");
                jLabel5.setVisible(true);
                jLabel6.setVisible(true);
                jLabel7.setVisible(true);
                jLabel8.setVisible(true);
                jLabel9.setVisible(true);
                jLabel10.setVisible(true);
                jLabel11.setVisible(true);
                jLabel12.setVisible(true);
                jTextField5.setVisible(true);
                jTextField6.setVisible(true);
                jTextField7.setVisible(true);
                jTextField8.setVisible(true);
                jTextField9.setVisible(true);
                jTextField10.setVisible(true);
                jTextField11.setVisible(true);
                jTextField12.setVisible(true);
                jButton5.setVisible(false);
                break;
            case 2:
                jTextField1.setEditable(false);
                jLabel1.setText("Cedula*: ");
                jLabel2.setText("Nombre: ");
                jLabel3.setText("Apellido: ");
                jLabel4.setText("Telefono: ");
                jLabel5.setText("Correo: ");
                jLabel6.setText("Genero: ");
                jLabel7.setText("Edad: ");
                jLabel8.setText("Direccion: ");
                jLabel9.setText("Ciudad: ");
                jLabel10.setText("Departamento: ");
                jLabel5.setVisible(true);
                jLabel6.setVisible(true);
                jLabel7.setVisible(true);
                jLabel8.setVisible(true);
                jLabel9.setVisible(true);
                jLabel10.setVisible(true);
                jLabel11.setVisible(false);
                jLabel12.setVisible(false);
                jTextField5.setVisible(true);
                jTextField6.setVisible(true);
                jTextField7.setVisible(true);
                jTextField8.setVisible(true);
                jTextField9.setVisible(true);
                jTextField10.setVisible(true);
                jTextField11.setVisible(false);
                jTextField12.setVisible(false);
                jButton5.setVisible(true);
                break;
            case 3:
                jTextField1.setEditable(false);
                jLabel1.setText("Cedula*: ");
                jLabel2.setText("Nombre: ");
                jLabel3.setText("Apellido: ");
                jLabel4.setText("Telefono: ");
                jLabel5.setText("Correo: ");
                jLabel6.setText("Genero: ");
                jLabel7.setText("Edad: ");
                jLabel8.setText("Direccion: ");
                jLabel9.setText("Ciudad: ");
                jLabel10.setText("Departamento: ");
                jLabel5.setVisible(true);
                jLabel6.setVisible(true);
                jLabel7.setVisible(true);
                jLabel8.setVisible(true);
                jLabel9.setVisible(true);
                jLabel10.setVisible(true);
                jLabel11.setVisible(false);
                jLabel12.setVisible(false);
                jTextField5.setVisible(true);
                jTextField6.setVisible(true);
                jTextField7.setVisible(true);
                jTextField8.setVisible(true);
                jTextField9.setVisible(true);
                jTextField10.setVisible(true);
                jTextField11.setVisible(false);
                jTextField12.setVisible(false);
                jButton5.setVisible(true);
                break;
            case 4:
                jTextField1.setEditable(true);
                jLabel1.setText("Nombre: ");
                jLabel2.setText("Descripcion: ");
                jLabel3.setText("Precio: ");
                jLabel4.setText("Cantidad: ");
                jLabel5.setText("Color: ");
                jLabel6.setText("Tipo: ");
                jLabel5.setVisible(true);
                jLabel6.setVisible(true);
                jLabel7.setVisible(false);
                jLabel8.setVisible(false);
                jLabel9.setVisible(false);
                jLabel10.setVisible(false);
                jLabel11.setVisible(false);
                jLabel12.setVisible(false);
                jTextField5.setVisible(true);
                jTextField6.setVisible(true);
                jTextField7.setVisible(false);
                jTextField8.setVisible(false);
                jTextField9.setVisible(false);
                jTextField10.setVisible(false);
                jTextField11.setVisible(false);
                jTextField12.setVisible(false);
                jButton5.setVisible(true);
                break;
            case 5:
                jTextField1.setEditable(true);
                jLabel1.setText("Cilindraje: ");
                jLabel2.setText("Descripcion: ");
                jLabel3.setText("Marca: ");
                jLabel4.setText("Tipo: ");
                jLabel5.setVisible(false);
                jLabel6.setVisible(false);
                jLabel7.setVisible(false);
                jLabel8.setVisible(false);
                jLabel9.setVisible(false);
                jLabel10.setVisible(false);
                jLabel11.setVisible(false);
                jLabel12.setVisible(false);
                jTextField5.setVisible(false);
                jTextField6.setVisible(false);
                jTextField7.setVisible(false);
                jTextField8.setVisible(false);
                jTextField9.setVisible(false);
                jTextField10.setVisible(false);
                jTextField11.setVisible(false);
                jTextField12.setVisible(false);
                jButton5.setVisible(true);
                break;
            case 6:
                jTextField1.setEditable(true);
                jLabel1.setText("Nombre: ");
                jLabel2.setText("Telefono: ");
                jLabel3.setText("Correo: ");
                jLabel4.setText("Direccion: ");
                jLabel5.setText("Ciudad: ");
                jLabel6.setText("Correo: ");
                jLabel5.setVisible(true);
                jLabel6.setVisible(true);
                jLabel7.setVisible(false);
                jLabel8.setVisible(false);
                jLabel9.setVisible(false);
                jLabel10.setVisible(false);
                jLabel11.setVisible(false);
                jLabel12.setVisible(false);
                jTextField5.setVisible(true);
                jTextField6.setVisible(true);
                jTextField7.setVisible(false);
                jTextField8.setVisible(false);
                jTextField9.setVisible(false);
                jTextField10.setVisible(false);
                jTextField11.setVisible(false);
                jTextField12.setVisible(false);
                jButton5.setVisible(true);
                break;
        }
    }
    
    /* actualiza el objeto tabla con informacion de la base de datos */
    private void updateTabla( int view )
    {
         cleanTextFields();
        
        //actualiza los datos de la tabla realizando una consulta a la base de datos
        String[] columNames = ctrl.getMasterColumnNames(view);
         
        if(!res.isEmpty())
        {
             res.clear();
        }
               
        res = ctrl.getMasterGetTabla(columNames, ctrl.getX(), columNames.length);
                     
        DefaultTableModel modelo = (DefaultTableModel) tabla.getModel();
        modelo.setColumnIdentifiers(columNames);
        
        if(res.isEmpty())
        {
            tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            columNames
            ));
        }
        else
        {
            if(modelo.getRowCount()>0)
            {
                // se borran los viejos valores de la tabla 
                for(int i=modelo.getRowCount()-1;i>=0;i--)
                {
                    modelo.removeRow(i);  
                }
            }
            // se colocan los datos en la tabla 
            for(int i=0;i<res.size();i++)
            {
                modelo.addRow(res.get(i));  
            }
        }
    }

    private void tableSelection()
    {
        int f=tabla.getSelectedRow();
        System.out.println("F: "+f);
        for(int i=0;i<res.get(f).length;i++)
        {
            switch(i)
            {
                case 0:
                    jTextField1.setText(""+res.get(f)[i]);
                case 1:
                    jTextField2.setText(""+res.get(f)[i]);
                case 2:
                    jTextField3.setText(""+res.get(f)[i]);
                case 3:
                    jTextField4.setText(""+res.get(f)[i]);
                case 4:
                    jTextField5.setText(""+res.get(f)[i]);
                case 5:
                    jTextField6.setText(""+res.get(f)[i]);
                case 6:
                    jTextField7.setText(""+res.get(f)[i]);
                case 7:
                    jTextField8.setText(""+res.get(f)[i]);
                case 8:
                    jTextField9.setText(""+res.get(f)[i]);
                case 9:
                    jTextField10.setText(""+res.get(f)[i]);
                case 10:
                    jTextField11.setText(""+res.get(f)[i]);
                case 11:
                    jTextField12.setText(""+res.get(f)[i]);
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tabla = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jTextField5 = new javax.swing.JTextField();
        jTextField6 = new javax.swing.JTextField();
        jTextField7 = new javax.swing.JTextField();
        jTextField8 = new javax.swing.JTextField();
        jTextField9 = new javax.swing.JTextField();
        jTextField10 = new javax.swing.JTextField();
        jTextField11 = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jTextField12 = new javax.swing.JTextField();

        setClosable(true);
        setPreferredSize(new java.awt.Dimension(950, 590));

        tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tabla.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tabla);

        jButton1.setText("<== Atras");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel1.setText("Label1:");

        jLabel2.setText("Label2:");

        jLabel3.setText("Label3:");

        jLabel4.setText("Label4:");

        jLabel5.setText("Label5:");

        jLabel6.setText("Label6:");

        jLabel7.setText("Label7:");

        jLabel8.setText("Label8:");

        jLabel9.setText("Label9:");

        jLabel10.setText("Label10:");

        jLabel11.setText("Label12:");

        jTextField3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField3ActionPerformed(evt);
            }
        });

        jButton3.setText("Borrar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Refrescar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("Guardar");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jLabel12.setText("Label12:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(832, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)
                        .addGap(515, 515, 515))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
                                .addGap(18, 18, 18))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                                .addGap(10, 10, 10))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                                .addGap(20, 20, 20)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
                                    .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE))
                                .addGap(513, 513, 513))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jTextField5, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)
                                .addGap(515, 515, 515))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
                                                .addGap(18, 18, 18))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                                                .addGap(1, 1, 1))
                                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                        .addGap(5, 5, 5)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jTextField9, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                                            .addComponent(jTextField10, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                                            .addComponent(jTextField11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                                            .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))))
                                .addGap(54, 54, 54)
                                .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTextField6, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)))
                                .addGap(86, 86, 86)
                                .addComponent(jButton3)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(82, 82, 82)
                                .addComponent(jButton4)
                                .addGap(80, 80, 80)
                                .addComponent(jButton5))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jTextField12)))
                        .addGap(54, 54, 54))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 924, Short.MAX_VALUE)
                        .addGap(35, 35, 35))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(8, 8, 8)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel12)
                    .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel4)
                            .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel8)
                            .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(11, 11, 11)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel9)
                            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel10)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(14, 14, 14)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel11)
                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(149, 149, 149)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton3)
                            .addComponent(jButton5)
                            .addComponent(jButton4))))
                .addContainerGap(63, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        this.hide();
        miAbd.show();
        in.repaint();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField3ActionPerformed

    private void tablaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMouseClicked
        tableSelection();
    }//GEN-LAST:event_tablaMouseClicked


    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JTable tabla;
    // End of variables declaration//GEN-END:variables

}



